<?php
	$help_articles = array
	(
		'articles'=>array
		(
			'1'=>array
			(
				'title'=>ucfirst(LANG_MODEL),
				'description'=>'Models are used for interaction between <a href="/guide/viewController/">Controllers</a> and DBMS. Each model class has the following variables.',
				'items'=>array
				(
					'1' => array
					(
						'title'=>'$database_config',
						'text'=>'<u>Description:</u> Determines what database configuration to use for the current model. 
								DB configurations are defined in the <i>config.php</i> file<br />
								<u>Values:</u> DB config name.<br />
								<u>Default:</u> db_config_default',
					),			
					'2' => array
					(
						'title'=>'$name',
						'text'=>'<u>Description:</u> Model name.<br />
								<u>Values:</u> Model name.<br />
								<u>Default:</u> -',
					),
					'3' => array
					(
						'title'=>'$table_name',
						'text'=>'<u>Description:</u> Database table name for the current model.<br />
								<u>Default:</u> -',
					),
					'4' => array
					(
						'title'=>'$stored_procedure_get',
						'text'=>'<u>Description:</u> DB stored procedure name for the GET operation.<br />
								<u>Default:</u> -',
					),
					'5' => array
					(
						'title'=>'$stored_procedure_insert',
						'text'=>'<u>Description:</u> DB stored procedure name for the INSERT operation.<br />
								<u>Default:</u> -',
					),
					'6' => array
					(
						'title'=>'$stored_procedure_update',
						'text'=>'<u>Description:</u> DB stored procedure name for the UPDATE operation.<br />
								<u>Default:</u> -',
					),
					'7' => array
					(
						'title'=>'$stored_procedure_list',
						'text'=>'<u>Description:</u> DB stored procedure name for the LIST operation.<br />
								<u>Default:</u> -.',
					),
					'8' => array
					(
						'title'=>'$stored_procedure_list_paged',
						'text'=>'<u>Description:</u> DB stored procedure name for the LIST PAGED operation.<br />
								<u>Default:</u> -.',
					),
					'9' => array
					(
						'title'=>'$db_structure',
						'text'=>'<u>Description:</u> Database tables\' structure.<br />
								<u>Values:</u> array <i>(described bellow)</i><br />
								<u>Default:</u> -',
					),
				)
			),
			
			'2'=>array
			(
				'title'=>'$db_structure',
				'description'=>'<b>$db_structure</b> is an array which reflects the DB structure. It describes all table columns used in the model.
								This array keys are aliases for the table column names from the DB. These aliases are used further in the application.
								Let\'s consider <b>$db_structure</b> array values. Each of them is an array, which consists of the elements described below.',
				'items'=>array
				(
					'1' => array
					(
						'title'=>'name',
						'text'=>'<u>Description:</u> field name in the DB.<br />
								<u>Values:</u> string.<br />
								<u>Default:</u> -',
					),			
					'2' => array
					(
						'title'=>'type',
						'text'=>'<u>Description:</u> DB field data type.<br />
								<u>Values:</u> data types from $database_formats in the current DB engine (/app/spherus_framework/dataengine/engines/*.php).<br />
								<u>Default:</u> -',
					),
					'3' => array
					(
						'title'=>'sub_type',
						'text'=>'<u>Description:</u> field subtype for validations and visual effects.<br />
								<u>Values:</u> email/url/percent/ip<br />
								<u>Default:</u> -',
					),
					'13' => array
					(
						'title'=>'regexp',
						'text'=>'<u>Description:</u> regular expression for the server side validations.<br />
								<u>Values:</u> perl competitive regular expression.<br />
								<u>Default:</u> -',
					),
					'14' => array
					(
						'title'=>'regexp_js',
						'text'=>'<u>Description:</u> regular expression for the JavaScript (browser) validations.<br />
								<u>Values:</u> perl competitive regular expression.<br />
								<u>Default:</u> -',
					),
					'4' => array
					(
						'title'=>'primary_key',
						'text'=>'<u>Description:</u> defines whether the field is a primary key in the DB or not.<br />
								<u>Values:</u> true/false<br />
								<u>Default:</u> false',
					),
					'5' => array
					(
						'title'=>'not_null',
						'text'=>'<u>Description:</u> Defines whether this field can be null or not.<br />
								<u>Values:</u> true/false<br />
								<u>Default:</u> false',
					),
					'6' => array
					(
						'title'=>'table_name',
						'text'=>'<u>Description:</u> DB table name for this field (if the field is not from the table, specified in <b>$table_name</b>).<br />
								<u>Default:</u> -.',
					),
					'7' => array
					(
						'title'=>'length',
						'text'=>'<u>Description:</u> Maximum length for the field\'s value.<br />
								<u>Default:</u> no limits.',
					),
					'12' => array
					(
						'title'=>'min_length',
						'text'=>'<u>Description:</u> Minimum length for the field\'s value.<br />
								<u>Default:</u> no limits.',
					),
					'8' => array
					(
						'title'=>'max_value',
						'text'=>'<u>Description:</u> Maximum value for this field\'s value.<br />
								<u>Default:</u> no limits.',
					),
					'9' => array
					(
						'title'=>'min_value',
						'text'=>'<u>Description:</u> Minimum value for this field\'s value.<br />
								<u>Default:</u> no limits.',
					),
					'10' => array
					(
						'title'=>'default_value',
						'text'=>'<u>Description:</u> Default value, that will be used as the field\'s value if it is not specified and should not be null.<br />
								<u>Default:</u> -',
					),
					'11' => array
					(
						'title'=>'by_default',
						'text'=>'<u>Description:</u> Default value for the field that will be shown in the view if no other value is specified.<br />
								<u>Default:</u> -',
					),
				)
			)
			
		)
	);
	
	$this->helpers->htmlx->MenuText1(LANG_MODEL.': '.LANG_GUIDE, "view.gif");
	$this->helpers->help->HelpTable($help_articles);
?>
